# angryoxide completion                                      -*- shell-script -*-

_available_interfaces() {
    COMPREPLY=($(iw dev | grep Interface | awk '{print $2}'))
}

_angryoxide()
{
    local cur prev words cword
    _init_completion || return

    case $prev in
        -i|--interface)
            _available_interfaces
            return 0
            ;;
        --targetlist|--whitelist|--output)
            _filedir
            return 0
            ;;
    esac

    if [[ $cword -eq 1 ]]; then
        if [[ $cur == --* ]]; then
            COMPREPLY=( $( compgen -W '--interface --channel --band --output --help --version --target-entry --whitelist-entry --targetlist --rate --combine --active --rogue --gpsd --autohunt --headless --autoexit --notransmit --notar --disablemouse --dwell --geofence --center --distance --geofence-timeout --disable-deauth --disable-pmkid --disable-anon --disable-csa --disable-disassoc --disable-roguem2' -- "$cur" ) )
        elif [[ $cur == -* ]]; then
            COMPREPLY=( $( compgen -W '-i -c -b -o -h -V -t -w -r' -- "$cur" ) )
        fi
    fi
} &&
complete -F _angryoxide angryoxide